---
title: 'Google'
icon: 'google'
description: 'Integrate Google Single Sign-On with Nile Auth'
---

<Steps>
<Step title="Setup Google Developer Console">
1. Create a [Google Developer](https://console.developers.google.com/) account.
2. Follow the documentation for [creating an OAuth 2.0 Client ID](https://developers.google.com/identity/protocols/oauth2) in Google.
3. Obtain a **Client ID** and **Client Secret** from [Google OAuth](https://console.cloud.google.com/apis/credentials). 
Be sure to set the redirect URL to your application handling the Nile Auth requests. 
If you are running locally and used the routes generated by `@niledatabase/server`, the redirect URL is `http://localhost:3000/api/auth/callback/google`.
  <Accordion title="Google dashboard example">
    <img height="500" width="500" src="/images/auth/googleexample.png" alt="Google SSO" />
  </Accordion>

</Step>

<Step title="Save Client ID and Client Secret in Nile">
  Save them to your database at `console.thenile.dev` under Google in **Tenants
  & Users -> Configuration** ![Google configuration on
  console.thenile.dev](/images/singlesignon/google.png)
</Step>

<Step title="Add the `Google` button to your login page">
The button will redirect the user to Google for authentication. Upon successful authentication, the user will be redirected back to your application.

```jsx
import { Google } from '@niledatabase/react';

function App() {
  return (
    <div>
      <Google callbackUrl="/" />
    </div>
  );
}
```

</Step>
</Steps>

## Related Providers

- [GitHub SSO](/auth/singlesignon/github)
- [Microsoft SSO](/auth/singlesignon/microsoft)
- [Discord SSO](/auth/singlesignon/discord)
